package top.yokey.shopnc.model;

import top.yokey.shopnc.base.BaseConstant;
import top.yokey.base.base.BaseHttpClient;
import top.yokey.base.base.BaseHttpListener;

@SuppressWarnings("ALL")
public class MemberReturnModel {

    private final String ACT = "member_return";
    private static volatile MemberReturnModel instance;

    public static MemberReturnModel get() {
        if (instance == null) {
            synchronized (MemberReturnModel.class) {
                if (instance == null) {
                    instance = new MemberReturnModel();
                }
            }
        }
        return instance;
    }

    public void shipForm(String returnId, BaseHttpListener baseHttpListener) {

        BaseHttpClient.get().ready(ACT, "ship_form")
                .add("return_id", returnId)
                .get(baseHttpListener);

    }

    public void getReturnList(String page, BaseHttpListener baseHttpListener) {

        BaseHttpClient.get().ready(ACT, "get_return_list")
                .add("page", BaseConstant.PAGE)
                .add("curpage", page)
                .get(baseHttpListener);

    }

    public void shipPost(String returnId, String expressId, String invoiceNo, BaseHttpListener baseHttpListener) {

        BaseHttpClient.get().ready(ACT, "ship_post")
                .add("return_id", returnId)
                .add("express_id", expressId)
                .add("invoice_no", invoiceNo)
                .post(baseHttpListener);

    }

}
